Kinetis SDK Demo Applications User Guide  1.0.0-beta
Freescale Semiconductor, Inc.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
rtc_func/src/main.c File Reference
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <limits.h>
#include "device/fsl_device_registers.h"
#include "fsl_rtc_driver.h"
#include "fsl_interrupt_manager.h"
#include "fsl_clock_manager.h"
#include "fsl_debug_uart.h"
#include "fsl_uart_hal.h"
#include "fsl_sim_hal.h"
#include "fsl_misc_utilities.h"
#include "shell.h"
#include "board.h"
#include <time.h>

Functions

static int32_t cmd_alarm (int argc, char *const argv[])
 set alarm command. More...
 
static int32_t cmd_date (int argc, char *const argv[])
 set/get date command. More...
 
static int32_t cmd_time (int argc, char *const argv[])
 get the current precise time. More...
 
static int32_t cmd_comp (int argc, char *const argv[])
 demo the compansation of RTC More...
 
static uint8_t Getchar (void)
 get a char More...
 
static void Putchar (uint8_t ch)
 put a char More...
 
static void rtc_alarm_isr (void)
 RTC alarm interrupt handler. More...
 
static void rtc_drv_init (void)
 RTC driver and hal init. More...
 
int main (void)
 main demo function. More...
 

Variables

static cmd_tbl_t cmd_table []
 
const cmd_tbl_t CommandFun_Help
 
static shell_io_install_t shell_io
 

Function Documentation

static int32_t cmd_alarm ( int  argc,
char *const  argv[] 
)
static

This function set the alarm which will be trigerred x secs later. The alarm trigger will print a notification on the console.

e.g >>alarm 100 set the alarm 100s from now on.

static int32_t cmd_comp ( int  argc,
char *const  argv[] 
)
static

This function set the compansation value and it's interval value. Demo the compansation result by the RTC_CLKOUT pin.

e.g >> comp 32896 20 Timer prescaler overflow every 32896 clock cycles, with 20s compensation interval.

static int32_t cmd_date ( int  argc,
char *const  argv[] 
)
static

This function get or set the date by the format YYYY-MM-DD hh:mm:ss

e.g >>date set 2013-12-01 12:12:00 set the datetime to 12/1/2013 12:12:00.

static int32_t cmd_time ( int  argc,
char *const  argv[] 
)
static

This function get the current precise time with the resolution of 30us

e.g >> time show the current time in a 30us resolution

static uint8_t Getchar ( void  )
static
int main ( void  )
static void Putchar ( uint8_t  ch)
static
static void rtc_alarm_isr ( void  )
static
static void rtc_drv_init ( void  )
static

Variable Documentation

cmd_tbl_t cmd_table[]
static
const cmd_tbl_t CommandFun_Help
shell_io_install_t shell_io
static